package com.example.customview;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TestViewOne extends LinearLayout {
    //ui
    private TextView tvTitle;
    private TextView tvMessage;

    public TestViewOne(Context context) {
        this(context,null);
    }

    public TestViewOne(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs,0);
    }

    public TestViewOne(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        bindView();
    }

    private void bindView() {
        tvTitle = findViewById(R.id.tv_title_view_one);
        tvMessage = findViewById(R.id.tv_message_view_one);
    }

    public void setTitle(String title){
        tvTitle.setText(title);
    }

    public void setMessage(String message){
        tvMessage.setText(message);
    }


}